package com.qyhl.shop.shop.search;

import com.qyhl.webtv.commonlib.entity.shop.ShopListBean;

import java.util.List;

public class ShopSearchPresenter implements ShopSearchContract.ShopSearchPresenter {
    private ShopSearchContract.ShopSearchView mView;
    private ShopSearchModel mModel;

    public ShopSearchPresenter(ShopSearchContract.ShopSearchView mView) {
        this.mView = mView;
        this.mModel = new ShopSearchModel(this);
    }

    @Override
    public void doSearch(String keyword, int page) {
        mModel.doSearch(keyword, page);
    }

    @Override
    public void setList(List<ShopListBean> beanList) {
        if (beanList == null || beanList.size() < 1) {
            mView.setList(null);
        } else {
            mView.setList(beanList);
        }
    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }
}
